/**
*/
(function(window) {

function decorate() {
	 var d = window.document, h, f, loc = window.location;
	 h = d.createElement("div");
	 f = d.createElement("div");
	 
	 h.style.position = 'fixed';
	 h.style.top = '0px';
	 h.style.left = '0px';
	 h.style.width = '100%';
	 h.style.height = '32px';
	 h.style.border = 'none';
	 h.style.padding= '0px';
	 h.style.backgroundColor = '#669933';
	 h.style.textAlign = 'left';
	 h.style.color = '#000';
	 h.style.zIndex = '3000';
	 
	 f.style.clear = 'both';
	 f.style.position = 'fixed';
	 f.style.bottom = '0px';
	 f.style.left = '0px';
	 f.style.backgroundColor = '#669933';
	 f.style.color = '#000000';
	 f.style.width = '100%';
	 f.style.height = '3px';
	 f.style.textAlign = 'center';
	 f.style.padding= '0px';
	 f.style.zIndex = '3000';
	 
	 //
	 if (loc.pathname.indexOf('/browse/') == 0) {
		 h.innerHTML = '<a href="/" style="text-decoration: none;"><span style="color: #ffffff; padding: 2px;">NIWOTA.INFO</span></a>&nbsp;&nbsp;<a href="#" style="text-decoration: none;" target="_blank" onclick="return niwota.viewOriginal(this);"><span style="color: #ff0000; padding: 2px;">original</span></a>';
	 } else {
		 h.innerHTML = '<a href="/" style="text-decoration: none;"><span style="color: #ffffff; padding: 2px;">NIWOTA.INFO</span></a>';
	 }
	 document.body.appendChild(h);
	 document.body.appendChild(f);
}

function viewOriginal(a) {
	var l = window.location + '?original=true';
	a.href = l;
	return true;
	//window.open(l,'','scrollbars=yes,menubar=no,height=600,width=800,resizable=yes,toolbar=no,location=no,status=no');
}

function toggle(s) {
	var el = window.document.getElementById(s);
	if(el.style.display == "block") {
		el.style.display = "none";
  	} else {
		el.style.display = "block";
	}
}

function init() {
	decorate();
}

init();

window.niwota = {
		viewOriginal: viewOriginal,
		toggle: toggle
};
})(window);
/**/